home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / hal.preinst < prev    next >
Text File  |  2009-10-05  |  2KB  |  70 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. rm_conffile() {
  6.   PKGNAME="hal"
  7.   CONFFILE="$1"
  8.  
  9.   if [ -e "$CONFFILE" ]; then
  10.    md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  11.    old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
  12.    if [ "$md5sum" != "$old_md5sum" ]; then
  13.      echo "Obsolete conffile $CONFFILE has been modified by you."
  14.      echo "Saving as $CONFFILE.dpkg-bak ..."
  15.      mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  16.    else
  17.      echo "Removing obsolete conffile $CONFFILE ..."
  18.      rm -f "$CONFFILE"
  19.    fi
  20.  fi
  21. }
  22.  
  23. case "$1" in
  24.   install|upgrade)
  25.     if dpkg --compare-versions "$2" le "0.5.2-1"; then
  26.       rm_conffile "/etc/hal/fdi/preferences.fdi"
  27.       rm_conffile "/etc/dev.d/block/hal-unmount.dev"
  28.     fi
  29.     if dpkg --compare-versions "$2" le "0.5.6-2"; then
  30.       rm_conffile "/etc/udev/scripts/device-removable.sh" 
  31.     fi
  32.     if dpkg --compare-versions "$2" le "0.5.6-4"; then
  33.       rm_conffile "/etc/hal/fdi/preferences.fdi"
  34.     fi
  35.     if dpkg --compare-versions "$2" le "0.5.7.1-1"; then
  36.       deluser --quiet --system hal > /dev/null || true
  37.     fi
  38.     if dpkg --compare-versions "$2" lt "0.5.9-3"; then
  39.       if [ -x /etc/dbus-1/event.d/20hal ]; then
  40.         /etc/dbus-1/event.d/20hal stop
  41.       fi
  42.       rm_conffile "/etc/dbus-1/event.d/20hal"
  43.     fi
  44.     if dpkg --compare-versions "$2" lt "0.5.11-3"; then
  45.       rm_conffile "/etc/udev/hal.rules"
  46.       rm -f /etc/udev/rules.d/z99_hal.rules
  47.     fi
  48.     if dpkg --compare-versions "$2" lt "0.5.12~git20090406.46dc48-1"; then
  49.       rm_conffile "/etc/udev/rules.d/90-hal.rules"
  50.     fi
  51. esac
  52.  
  53. # Automatically added by dh_installinit
  54. if [ "$1" = install ] || [ "$1" = upgrade ]; then
  55.     if [ -e "/etc/init.d/hal" ] && [ ! -L "/etc/init.d/hal" ]; then
  56.         if [ "`md5sum \"/etc/init.d/hal\" | sed -e \"s/ .*//\"`" != \
  57.              "`dpkg-query -W -f='${Conffiles}' hal | sed -n -e \"\\\\' /etc/init.d/hal '{s/ obsolete$//;s/.* //p}\"`" ]
  58.         then
  59.             echo "Obsolete conffile /etc/init.d/hal has been modified by you, renaming to .dpkg-bak"
  60.             mv -f "/etc/init.d/hal" "/etc/init.d/hal.dpkg-bak"
  61.         else
  62.             rm -f "/etc/init.d/hal"
  63.         fi
  64.     fi
  65. fi
  66. # End automatically added section
  67.  
  68.  
  69. exit 0
  70.